package domain.PDU;

/**
 * @Author: ylc
 * @Description:
 */
public class PDU {
    /**
     * PDU类型
     */
    private String pduType;
    /**
     * 请求标识
     */
    private String requestId;
    /**
     * 错误状态
     */
    private String errorStatus;
    /**
     * 错误索引
     */
    private String errorIndex;
    /**
     * 变量绑定表
     */
    private VariableBindings variableBindings;

    public PDU() {
    }

    public PDU(String pduType, String requestId, String errorStatus, String errorIndex, VariableBindings variableBindings) {
        this.pduType = pduType;
        this.requestId = requestId;
        this.errorStatus = errorStatus;
        this.errorIndex = errorIndex;
        this.variableBindings = variableBindings;
    }

    @Override
    public String toString() {
        return pduType +
                "\n   " + pduType +
                "\n     request-id : " + requestId +
                "\n     error-status : " + errorStatus +
                "\n     error-index : " + errorIndex +
                "\n     variable-bindings : " + variableBindings;
    }

    public String getPduType() {
        return pduType;
    }

    public void setPduType(String pduType) {
        this.pduType = pduType;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getErrorStatus() {
        return errorStatus;
    }

    public void setErrorStatus(String errorStatus) {
        this.errorStatus = errorStatus;
    }

    public String getErrorIndex() {
        return errorIndex;
    }

    public void setErrorIndex(String errorIndex) {
        this.errorIndex = errorIndex;
    }

    public VariableBindings getVariableBindings() {
        return variableBindings;
    }

    public void setVariableBindings(VariableBindings variableBindings) {
        this.variableBindings = variableBindings;
    }
}
